package love.yuanmengrobot.guoyitang.controller;

/*
 *   @Studio:CHJY · 源梦科技
 *   @Author:lzl
 *   @Ide:IntelliJ IDEA
 *   @Creation time:2021/8/11 10:27
 */

import love.yuanmengrobot.guoyitang.entity.TbNatmehaHotspot;
import love.yuanmengrobot.guoyitang.service.HotSpotsService;
import love.yuanmengrobot.guoyitang.vo.Vo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("hotSpots")
@CrossOrigin
public class HotSpotsController {

    @Autowired
    private HotSpotsService hotSpotsService;

    @RequestMapping("/index")
    public Vo hotSpotsIndex(Integer current, Integer size, String dataType){

        return hotSpotsService.queryByLimit(current, size, dataType);
    }

    @RequestMapping("getDetails")
    public TbNatmehaHotspot getDetails(String idAndCode){
        String[] value = idAndCode.split("-");
        return hotSpotsService.queryByIdAndCode(value[0],value[1]);
    }
}
